This report will analyse the data available from the Recoupling Dashboard and observe the implications of its findings.

library(ggpubr)
library(extrafont)
library(markdown)
library(ggpubr)
library(knitr)
library(carpenter)
library(tidyverse)
library(dplyr)
library(haven)
library(foreign)
library(readr)
library(readxl)
library(tibble)
library(naniar)
library(viridis)
library(ggsci)
library(ggplot2)
library(gridExtra)

As our main priority will be to look at the correlations between agency and solidarity, we will select all variables related to both dimensions and the main representatives of Material Gains (GDP per Capita) and Environmental Protection (per Capita CO2 emissions).

The variables related to agency are Agency Index, 1-year change Agency, and 10-year change Agency. The ones related to solidarity are Solidarity Index, 1-year change Solidarity, 10-year change Solidarity, Inward Solidarity Index, 1-year change Inward Solidarity, 10-year change Inward Solidarity, Outward Solidarity Index, 1-year change Outward Solidarity, and 10-year change Outward Solidarity.

Overall, we observe 88 entries in the new dataset that have data available on every variable.

Note: Instead of EPI (Environmental Protection Index), the column that we used in the two previous reports, we will operate with CO2 Emissions per capita as the criteria for environmental protection.

Second Note: There were solely two entries that remained in the “Low Income” group during the data analysis process. As Ethiopia and Uganda are the only “Low income” countries to stay in the dataset, we will incorporate them into the “Lower middle income” group to ease reading the plots and visualization. For that reason, we will change their categories.

The relationship between Agency and Solidarity

Now, we will plot the correlation between the Agency Index and Solidarity index

The correlation between Agency index and Solidarity is positive. It is curious to notice that most countries are scattered through the map but as they proceed upward, they tends to realign at the top left quadrant of the graph, representing an homogeneity between countries who have high solidarity and agency. Also, there are not many outliers.

Looking at Pearsons Correlation and obtaining the estimates.

cor_agsol <- cor.test(main_var_2020$agency_index, main_var_2020$solidarity_index, method = "pearson")

cor_agsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$agency_index and main_var_2020$solidarity_index
## t = 10.665, df = 86, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.6475113 0.8324849
## sample estimates:
##       cor 
## 0.7546155

As the correlation is 0.75, it shows a high similarity between both indexes.

And the T-test in order to obtain the visualization of the p-value.

test_agsol <- t.test(main_var_2020$agency_index, main_var_2020$solidarity_index)

test_agsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$agency_index and main_var_2020$solidarity_index
## t = 1.0729, df = 138.57, p-value = 0.2852
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.01474116  0.04972062
## sample estimates:
## mean of x mean of y 
## 0.6658689 0.6483791

As we will be able to see, the p-value will be 0.28.

Observing the correlation by Income group

ggplot(main_var_2020, aes(x = agency_index, y = solidarity_index)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "Agency Index", y = "Solidarity Index") + labs(title = "Correlation between Solidarity and Agency by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

Looking at the Income Groups, we can observe that the validation of our preliminary idea that lower middle income countries are more scattered than the other two groups.

In Facets:

ggplot(main_var_2020, aes(x = agency_index, y = solidarity_index)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_hline(aes(yintercept = mean(solidarity_index)), color = "sienna2") + theme_minimal() + labs(x = "Agency Index", y = "Solidarity Index") + labs(title = "Correlation between Solidarity and Agency by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Here we can see that the correlation between lower middle income groups is quite low. Also, they have more dots scattered through the map. Also is interesting that the mean line of solidarity is a threshold and a relevant numbers of all groups stays below it. Furthermore, solely five countries lower middle income and upper middle income above it. Thereby, there is not a hugely progression between both groups until the “High income” group.

Agency and Inward Solidarity

  e <- ggplot(main_var_2020, aes(x = agency_index, y = inward_sol_index)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "lightsalmon3", fill = "peachpuff3") + geom_point(color = "navajowhite3", alpha = .6) + 
    labs(title = "Relation between Agency and Inward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
    labs(x = "Agency Index", y = "Inward Solidarity Index") + theme_minimal() + geom_hline(aes(yintercept = mean(inward_sol_index)), color = "red4") + 
    geom_vline(aes(xintercept = mean(agency_index)), color = "lightcoral") +
    scale_y_continuous(limits = c(0.4, 1)) 

e

The correlation between Agency and Inward Solidarity seems positive even though its not so high as Ag and Solidarity. Furthermore, numbers seem to be more spread among every quadrant.

cor_aginsol <- cor.test(main_var_2020$agency_index, main_var_2020$inward_sol_index, method = "pearson")

cor_aginsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$agency_index and main_var_2020$inward_sol_index
## t = 8.3366, df = 86, p-value = 1.1e-12
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.5338439 0.7701441
## sample estimates:
##       cor 
## 0.6685374
test_aginsol <- t.test(main_var_2020$agency_index, main_var_2020$inward_sol_index)

test_aginsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$agency_index and main_var_2020$inward_sol_index
## t = -9.2792, df = 166.94, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.2050002 -0.1330708
## sample estimates:
## mean of x mean of y 
## 0.6658689 0.8349043

The correlation is 0.66. Also worth to highlight that the mean of Inward Solidarity is 0.83, which is quite high and above the agency index meand correlation. Thus, there could be a connection between social cohesion and redistributive politics and the capacity to influence prosperity.

Looking at different income groups:

ggplot(main_var_2020, aes(x = agency_index, y = inward_sol_index)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "Agency Index", y = "Inward Solidarity Index") + labs(title = "Correlation between Inward Solidarity and Agency by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

In Facets

ggplot(main_var_2020, aes(x = agency_index, y = inward_sol_index)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_hline(aes(yintercept = mean(inward_sol_index)), color = "red4") + theme_minimal() + labs(x = "Agency Index", y = "Inward Solidarity Index") + labs(title = "Correlation between Inward Solidarity and Agency by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Here the scenario differs from solidarity. While almost no lower middle income country is above the mean, almost all of the ones from the High income are. Moreover, we can observe a proper progression accordingly to the group.

On the lower middle income group there are also more extremes, which may indicate a higher degree of mistrust among countries that have low agency. As a result, there would be wariness of redistribution as it would be an idea of privilege among certain communities but not another.

Agency and Outward Solidarity

  f <- ggplot(main_var_2020, aes(x = agency_index, y = outward_sol_index)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "saddlebrown", fill = "salmon2") + geom_point(color = "bisque3", alpha = .6) + 
    labs(title = "Relation between Agency and Outward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
    labs(x = "Agency Index", y = "Outward Solidarity Index") + theme_minimal() + geom_hline(aes(yintercept = mean(outward_sol_index)), color = "navajowhite4") + 
    geom_vline(aes(xintercept = mean(agency_index)), color = "lightcoral") +
    scale_y_continuous(limits = c(0.4, 1))


f

Different from the other types of solidarity, the overall levels of Outward Solidarity tinds to be low. It makes sense at the current moment as countries are focusing on the welfare of their population first instead of looking for multiteralism measures to contain climate change or covid.

The disparity between the lowest point of Outward Solidarity and its apex is not so rampant as inward solidarity. Even thought the correlation is positive, the variation is not great.

cor_agoutsol <- cor.test(main_var_2020$agency_index, main_var_2020$outward_sol_index, method = "pearson")

cor_agoutsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$agency_index and main_var_2020$outward_sol_index
## t = 5.1493, df = 86, p-value = 1.636e-06
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.3072442 0.6307588
## sample estimates:
##       cor 
## 0.4854479
test_agoutsol <- t.test(main_var_2020$agency_index, main_var_2020$outward_sol_index)

test_agoutsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$agency_index and main_var_2020$outward_sol_index
## t = 12.019, df = 151.18, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.1704769 0.2375530
## sample estimates:
## mean of x mean of y 
## 0.6658689 0.4618539

By Income

ggplot(main_var_2020, aes(x = agency_index, y = outward_sol_index)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "Agency Index", y = "Outward  Solidarity Index") + labs(title = "Correlation between Outward Solidarity and Agency by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

As we can see, every Income Group has countried that are pictured across the axis. Additionally, the Income Group are not clustered among themselves, as between 0.6 - 0.7 it is possible to perceive the interaction ebtween Lower Middle Income with High Income countries.

By Facet

ggplot(main_var_2020, aes(x = agency_index, y = outward_sol_index)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_hline(aes(yintercept = mean(outward_sol_index)), color = "navajowhite4") + theme_minimal() + labs(x = "Agency Index", y = "Outward Solidarity Index") + labs(title = "Correlation between Outward Solidarity and Agency by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Different from the previous two comparisons with agency, here high income countries have a steeper curve while Lower Middle Income and Upper Middle income curves resemble each other. Furthermore, there is a relevant number of countries in all groups that are below the mean of Outward Solidarity. Surprisingly, the number of Lower Middle Income countries that are above the mean is superior than the other two solidarity means.

Tying Inward and Outward Solidarity using grid.Extra

ee <- ggplot(main_var_2020, aes(x = agency_index, y = inward_sol_index)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "lightsalmon3", fill = "peachpuff3") + geom_point(color = "navajowhite3", alpha = .6) + 
    labs(x = "Agency Index", y = "Inward Solidarity Index") + theme_minimal() + geom_hline(aes(yintercept = mean(inward_sol_index)), color = "red4") + 
    geom_vline(aes(xintercept = mean(agency_index)), color = "lightcoral") +
    scale_y_continuous(limits = c(0.4, 1))

ff <- ggplot(main_var_2020, aes(x = agency_index, y = outward_sol_index)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "saddlebrown", fill = "salmon2") + geom_point(color = "bisque3", alpha = .6) +
    labs(x = "Agency Index", y = "Outward Solidarity Index") + theme_minimal() + geom_hline(aes(yintercept = mean(outward_sol_index)), color = "navajowhite4") + 
    geom_vline(aes(xintercept = mean(agency_index)), color = "lightcoral") +
    scale_y_continuous(limits = c(0.4, 1))
grid.arrange(ee, ff, nrow = 1, top = "Agency and the Inward/Outward Solidarity")

As previously observed, the mean of Inward solidarity is incredibly high when compared with the one of Outward solidarity. Also, while the correlation of Inward Solidarity and Agency is progressively steeper, the Outward Solidarity curva is rounder. Notably, Inward Solidarity x Agency seems not clustered inward, but there are no nodes between High Income countries and Lower Income Countries. The contrary happens at Outward Solidarity x Agency.

Between 1-Year Change Agency and 1-Year Change Solidarity

  b <- ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_sol)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) + 
    labs(title = "Relation between One Year Change Agency and One Year Change in Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
    labs(x = "One year Agency", y = "One Year Change in Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(oney_change_sol)), color = "coral3") +
    geom_vline(aes(xintercept = mean(oney_change_ag)), color = "salmon4")

b

The correlation is quite low and the confidence interval shows the strong disparity between countries. However, as it shows changes in one year, the mean lines did not registered hugely changes, but the correlation curve was sensible to the sparcity of countries in every quadrant.

cor_onye_agsol <- cor.test(main_var_2020$oney_change_ag, main_var_2020$oney_change_sol, method = "pearson")

cor_onye_agsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$oney_change_ag and main_var_2020$oney_change_sol
## t = 1.1722, df = 86, p-value = 0.2444
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.08630571  0.32627604
## sample estimates:
##       cor 
## 0.1254033
test_onye_agsol <- t.test(main_var_2020$oney_change_ag, main_var_2020$oney_change_sol)

test_onye_agsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$oney_change_ag and main_var_2020$oney_change_sol
## t = -1.6913, df = 166.44, p-value = 0.09266
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.027858767  0.002151165
## sample estimates:
##   mean of x   mean of y 
## 0.009851518 0.022705319

As the p-value is 0.09, there may be the possibility of no correlation between the growth of agency and solidarity. Which makes sense due to the disparity of countries showed in the previous graphs.

By Income

  ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_sol)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
    theme_minimal() + labs(x = "One Year Change in Agency", y = "One Year Change in Solidarity") + labs(title = "Correlation between One Year Change in Agency and One Year Change in Solidarity by Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5)) 

  ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_sol)) + geom_point(aes(color = IncomeGroup)) + 
    geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + 
    scale_color_locuszoom(name = "Income Group") +
    scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) +
    theme_minimal() + 
    labs(x = "One Year Change in Agency", y = "One Year Change in Solidarity") + labs(title = "Correlation between One Year Change in Agency and Solidarity by Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + geom_hline(aes(yintercept = mean(oney_change_sol)), color = "sienna2") + stat_cor(aes(color = IncomeGroup))

Here we can see low correlation in all groups. However, Lower Middle Class and Upper Middle Class resemble each other whule High Income has the opposite direction and concavity.

Between 1-Year Change Agency and 1-Year Change Inward Solidarity

ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_sol_inward)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) + 
    labs(title = "Relation between One year change Agency and One year change Inward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
    labs(x = "One year Agency Index", y = "One Year Change Inward Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(oney_change_sol_inward)), color = "red4") +
    geom_vline(aes(xintercept = mean(oney_change_ag)), color = "salmon4")

Here the corelation seems negative. Also, the curve goes below the One Year Change Inward Solidarity mean line.

Viewing correlations

cor_onye_aginsol <- cor.test(main_var_2020$oney_change_ag, main_var_2020$oney_change_sol_inward, method = "pearson")

cor_onye_aginsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$oney_change_ag and main_var_2020$oney_change_sol_inward
## t = -0.9026, df = 86, p-value = 0.3693
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.3002236  0.1149009
## sample estimates:
##         cor 
## -0.09687262
test_onye_aginsol <- t.test(main_var_2020$oney_change_ag, main_var_2020$oney_change_sol_inward)

test_onye_aginsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$oney_change_ag and main_var_2020$oney_change_sol_inward
## t = 1.2819, df = 153.06, p-value = 0.2018
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.005892088  0.027666950
## sample estimates:
##    mean of x    mean of y 
##  0.009851518 -0.001035913

By Income Group

  ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_sol_inward)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
    theme_minimal() + labs(x = "One Year Change in Agency", y = "One Year Change Inward Solidarity") + labs(title = "Correlation between One Year Change in Agency and One Year Change Inward Solidarity by Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5)) 

  ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_sol_inward)) + geom_point(aes(color = IncomeGroup)) + 
    geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + 
    scale_color_locuszoom(name = "Income Group") +
    scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) +
    theme_minimal() + 
    labs(x = "One Year Change in Agency", y = "One Year Change Inward Solidarity") + labs(title = "Correlation between One Year Change in Agency and One Year Change Inward Solidarity by Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + geom_hline(aes(yintercept = mean(oney_change_sol_inward)), color = "red4") + stat_cor(aes(color = IncomeGroup))

Among Income Groups, the correlations are all negative. Every Income Group shows a different trajectory. However, different from the other two, High Income countries are clustered and has a tenous confidence interval. Meanwhile, Upper Middle Income and espacially Lower Middle Income ones have a high proportion of disparities.

Between 1-Year Change Agency and 1-Year Change Outward Solidarity

ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_s_outward)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) + 
    labs(title = "Relation between One year change Agency and One year change Outward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
    labs(x = "One year Agency Index", y = "One Year Change Outward Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(oney_change_s_outward)), color = "navajowhite4") +
    geom_vline(aes(xintercept = mean(oney_change_ag)), color = "salmon4")

The correlation of One Year Change in Outward Solidarity seems positive. Most countries seem clustered around the encounter of the mean lines.

Viewing correlations

cor_onye_agoutsol <- cor.test(main_var_2020$oney_change_ag, main_var_2020$oney_change_s_outward, method = "pearson")

cor_onye_agoutsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$oney_change_ag and main_var_2020$oney_change_s_outward
## t = 2.9052, df = 86, p-value = 0.004665
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.09548481 0.47843480
## sample estimates:
##       cor 
## 0.2989485
test_onye_agoutsol <- t.test(main_var_2020$oney_change_ag, main_var_2020$oney_change_s_outward)

test_onye_agoutsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$oney_change_ag and main_var_2020$oney_change_s_outward
## t = -4.9998, df = 103.83, p-value = 2.341e-06
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.11160825 -0.04821681
## sample estimates:
##   mean of x   mean of y 
## 0.009851518 0.089764050
ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_s_outward)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
    theme_minimal() + labs(x = "One Year Change in Agency", y = "One Year Change Outward Solidarity") + labs(title = "Correlation between One Year Change in Agency and One Year Change Outward Solidarity by Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5)) 

  ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_s_outward)) + geom_point(aes(color = IncomeGroup)) + 
    geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + 
    scale_color_locuszoom(name = "Income Group") +
    scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) +
    theme_minimal() + 
    labs(x = "One Year Change in Agency", y = "One Year Change Outward Solidarity") + labs(title = "Correlation between One Year Change in Agency and One Year Change Outward Solidarity by Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + geom_hline(aes(yintercept = mean(oney_change_s_outward)), color = "navajowhite4") + stat_cor(aes(color = IncomeGroup))

The correlation is positive in all Income Groups.

Different from Inward Solidarity, the position of correlation curves differ in relation to the mean. It’s almost a contrasting position to Inward Solidarity. However, it seems to show the predisposition of countries to act as a community, as it slowly moves in relation to the correlation of Agency index with Outward Soliarity Index.

Between 10-Year Change Agency and 10-Year Change Solidarity

  c <- ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_sol)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "salmon4", fill = "tan2") + geom_point(color = "tomato2", alpha = .6) + 
    labs(title = "Relation between Ten Year Change Agency and Ten year change in Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
    labs(x = "Ten Year Change Agency", y = "Ten Year Change in Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(teny_change_sol)), color = "rosybrown") +
    geom_vline(aes(xintercept = mean(teny_change_ag)), color = "burlywood")

c

The correlation of ten years change is positive, but seems to be moved by a disparity of a few countries above both means quadrant while the countries on the below them.

Viewing correlation

cor_tenye_agsol <- cor.test(main_var_2020$teny_change_ag, main_var_2020$teny_change_sol, method = "pearson")

cor_tenye_agsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$teny_change_ag and main_var_2020$teny_change_sol
## t = 5.9752, df = 86, p-value = 5.058e-08
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.3746917 0.6745502
## sample estimates:
##       cor 
## 0.5416289
test_tenye_agsol <- t.test(main_var_2020$teny_change_ag, main_var_2020$teny_change_sol)

test_tenye_agsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$teny_change_ag and main_var_2020$teny_change_sol
## t = 3.5734, df = 171.64, p-value = 0.0004576
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.02818165 0.09773591
## sample estimates:
##  mean of x  mean of y 
## 0.12150461 0.05854583
  ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_sol)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
    theme_minimal() + labs(x = "Ten Year Change in Agency", y = "Ten Year Change in Solidarity") + labs(title = "Correlation between Ten year Change in Agency and Ten Year Change in Solidarity by Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5))

  ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_sol)) + geom_point(aes(color = IncomeGroup)) +
    geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + 
    scale_color_locuszoom(name = "Income Group") +
    scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) +
    theme_minimal() + 
    labs(x = "Ten Year Change Agency", y = "Ten Year Change in Solidarity") + labs(title = "Correlation between Ten Year Change Agency and Ten Year Change in Solidarity by Individual Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + geom_hline(aes(yintercept = mean(teny_change_sol)), color = "rosybrown") + stat_cor(aes(color = IncomeGroup))

Here we can see a strong correlation between Upper Middle Income and High Income groups. One could say that their growth is more structured while the ones on Lower Middle Income are unstable. However, they are not so concentrated as change in one year in solidarity. Also, the fact that on High Income and Upper Middle Income countries, the correlation of Agency and Solidarity indexes are already high can have a confounding effect, thus propelling it further.

Between 10-Year Change in Agency and 10-Year Change Inward Solidarity

ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_s_inward)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) + 
    labs(title = "Relation between Ten Year Change Agency and Ten Year Change Inward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
    labs(x = "Ten Year Change Agency", y = "Ten Year Change Inward Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(teny_change_s_inward)), color = "red4") +
    geom_vline(aes(xintercept = mean(teny_change_ag)), color = "burlywood")

The correlation is slightly positive. However, most changes among countries were almost static due to the proixmitiy with the mean lines - which are close to 0.

Viewing correlation

cor_tenye_aginsol <- cor.test(main_var_2020$teny_change_ag, main_var_2020$teny_change_s_inward, method = "pearson")

cor_tenye_aginsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$teny_change_ag and main_var_2020$teny_change_s_inward
## t = 1.7623, df = 86, p-value = 0.08157
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.0236714  0.3812317
## sample estimates:
##       cor 
## 0.1866965
test_tenye_aginsol <- t.test(main_var_2020$teny_change_ag, main_var_2020$teny_change_s_inward)

test_tenye_aginsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$teny_change_ag and main_var_2020$teny_change_s_inward
## t = 6.3824, df = 172.41, p-value = 1.555e-09
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.07842818 0.14865576
## sample estimates:
##   mean of x   mean of y 
## 0.121504611 0.007962644

By Income

  ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_s_inward)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
    theme_minimal() + labs(x = "Ten Year Change in Agency", y = "Ten Year Change Inward Solidarity") + labs(title = "Correlation between Ten year Change in Agency and Ten Year Change Inward Solidarity by Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5))

  ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_s_inward)) + geom_point(aes(color = IncomeGroup)) +
    geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + 
    scale_color_locuszoom(name = "Income Group") +
    scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) +
    theme_minimal() + 
    labs(x = "Ten Year Change Agency", y = "Ten Year Change Inward Solidarity") + labs(title = "Correlation between Ten Year Change Agency and Ten Year Change Inward Solidarity by Individual Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + geom_hline(aes(yintercept = mean(teny_change_s_inward)), color = "red4") + stat_cor(aes(color = IncomeGroup))

It is important to highlight the position of all correlations of Income Groups. They intersect with one another, showing that progress on Inward Solidarity has been slow overall in the ten years period. Maybe it could be explained by growing inequality and the corrosion of social fabric in the last decade that allowed the appearance of nativist movements.

Between 10-Year Change in Agency and 10-Year Change Outward Solidarity

ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_s_outward)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) + 
    labs(title = "Relation between Ten Year Change Agency and Ten Year Change Outward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
    labs(x = "Ten Year Change Agency", y = "Ten Year Change Outward Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(teny_change_s_outward)), color = "navajowhite4") +
    geom_vline(aes(xintercept = mean(teny_change_ag)), color = "burlywood")

Curiously, it seems that the correlation of Ten Year Change in Outward Solidarity had a steep positive correlation. Moreover, it seems to not possess great outliers due to the p-value. Even though the last decade saw tumultuous events, such as the eurozone crisis, the 2016 elections, brexit, the 2013 protests in Brazil, a counter-coup in Turkey and so fort, there was still remarkable achievements that would be unthinkinkable before, such as the Paris Agreement.

Viewing correlation

cor_tenye_agoutsol <- cor.test(main_var_2020$teny_change_ag, main_var_2020$teny_change_s_outward, method = "pearson")

cor_tenye_agoutsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$teny_change_ag and main_var_2020$teny_change_s_outward
## t = 8.28, df = 86, p-value = 1.433e-12
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.5305876 0.7682891
## sample estimates:
##       cor 
## 0.6660171
test_tenye_agoutsol <- t.test(main_var_2020$teny_change_ag, main_var_2020$teny_change_s_outward)

test_tenye_agoutsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$teny_change_ag and main_var_2020$teny_change_s_outward
## t = -2.702, df = 124.64, p-value = 0.007852
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.14319726 -0.02211217
## sample estimates:
## mean of x mean of y 
## 0.1215046 0.2041593
  ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_s_outward)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
    theme_minimal() + labs(x = "Ten Year Change in Agency", y = "Ten Year Change Outward Solidarity") + labs(title = "Correlation between Ten Year Change in Agency and Ten Year Change Outward Solidarity by Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5))

  ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_s_outward)) + geom_point(aes(color = IncomeGroup)) +
    geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + 
    scale_color_locuszoom(name = "Income Group") +
    scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) +
    theme_minimal() + 
    labs(x = "Ten Year Change Agency", y = "Ten Year Change Outward Solidarity") + labs(title = "Correlation between Ten Year Change Agency and Ten Year Change Outward Solidarity by Individual Income Group") + 
    theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + geom_hline(aes(yintercept = mean(teny_change_s_outward)), color = "navajowhite4") + stat_cor(aes(color = IncomeGroup))

We can see a positive correlation to all groups. Moreover, it seems that there are no clusters in any of time. it is also important to hughlight that the format of the curve follows a similar pattern, even though in different degrees of steepness. As a result, it may shows a natural disposition to multilateralism as countries develop, if it can solve current challenges such as inequality, corruption and so forth.

Experimenting with grid.Extra using the changes of Solidarity across time

# Solidarity and Agency
aa <- ggplot(main_var_2020, aes(x = agency_index, y = solidarity_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood3", fill = "darkorange1") + geom_point(color = "bisque3", alpha = .6) + 
  labs(x = "Agency Index", y = "Solidarity Index") + theme_minimal() + geom_hline(aes(yintercept = mean(solidarity_index)), color = "sienna2") + 
  geom_vline(aes(xintercept = mean(agency_index)), color = "wheat4") + scale_y_continuous(limits = c(-0.5, 1.0)) 

aa
# One Year Change

bb <- ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_sol)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) + 
    labs(x = "One year Agency Index", y = "One Year Change Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(oney_change_sol)), color = "red4") +
    geom_vline(aes(xintercept = mean(oney_change_ag)), color = "salmon4") + scale_y_continuous(limits = c(-0.5, 1))

bb
# 10 Years Change

cc <- ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_sol)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "salmon4", fill = "tan2") + geom_point(color = "tomato2", alpha = .6) + 
    labs(x = "Ten Year Change Agency", y = "Ten Year Change in Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(teny_change_sol)), color = "rosybrown") +
    geom_vline(aes(xintercept = mean(teny_change_ag)), color = "burlywood") + 
    scale_y_continuous(limits = c(-0.5, 1.0)) 

cc
  d <- grid.arrange(aa, bb, cc, nrow = 1, top = "Change of Agency and Solidarity across time")

  d
## TableGrob (2 x 3) "arrange": 4 grobs
##   z     cells    name                 grob
## 1 1 (2-2,1-1) arrange       gtable[layout]
## 2 2 (2-2,2-2) arrange       gtable[layout]
## 3 3 (2-2,3-3) arrange       gtable[layout]
## 4 4 (1-1,1-3) arrange text[GRID.text.3114]

The correlation between the Agency index and Solidarity is quite stable. There is a perceptible progress in the numbers, as the curve in both graphs is overall positive. Change from one year seems constant while there is a higher tendency of Ten Year Change to show that Agency and Solidarity push one another.

Using grid.Extra for the changes in Inward Solidarity across time

dd <- ggplot(main_var_2020, aes(x = agency_index, y = inward_sol_index)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "lightsalmon3", fill = "peachpuff3") + geom_point(color = "navajowhite3", alpha = .6) + labs(x = "Agency Index", y = "Inward Solidarity Index") + theme_minimal() + geom_hline(aes(yintercept = mean(inward_sol_index)), color = "red4") + 
    geom_vline(aes(xintercept = mean(agency_index)), color = "lightcoral") + scale_y_continuous(limits = c(-0.2, 1)) 

ff <- ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_sol_inward)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) +   labs(x = "One year Agency Index", y = "One Year Change Inward Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(oney_change_sol_inward)), color = "red4") +
    geom_vline(aes(xintercept = mean(oney_change_ag)), color = "salmon4") + scale_y_continuous(limits = c(-0.2, 1)) 

ee <- ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_s_inward)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) + 
  labs(x = "Ten Year Change Agency", y = "Ten Year Change Inward Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(teny_change_s_inward)), color = "red4") +
    geom_vline(aes(xintercept = mean(teny_change_ag)), color = "burlywood") + scale_y_continuous(limits = c(-0.2, 1)) 
g <- grid.arrange(dd, ff, ee, nrow = 1, top = "Change of Agency and Inward Solidarity across time")

g
## TableGrob (2 x 3) "arrange": 4 grobs
##   z     cells    name                 grob
## 1 1 (2-2,1-1) arrange       gtable[layout]
## 2 2 (2-2,2-2) arrange       gtable[layout]
## 3 3 (2-2,3-3) arrange       gtable[layout]
## 4 4 (1-1,1-3) arrange text[GRID.text.3241]

Solidarity Inward differs from Solidarity due to the lack of correlation in the Years Change. An hypothesis would

Using grid.Extra for the changes in Outward Solidarity across time

hh <- ggplot(main_var_2020, aes(x = agency_index, y = outward_sol_index)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "saddlebrown", fill = "salmon2") + geom_point(color = "bisque3", alpha = .6) +
    labs(x = "Agency Index", y = "Outward Solidarity Index") + theme_minimal() + geom_hline(aes(yintercept = mean(outward_sol_index)), color = "navajowhite4") + 
    geom_vline(aes(xintercept = mean(agency_index)), color = "lightcoral") + scale_y_continuous(limits = c(-0.2, 1))

ii <- ggplot(main_var_2020, aes(x = oney_change_ag, y = oney_change_s_outward)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) + 
    labs(x = "One year Agency Index", y = "One Year Change Outward Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(oney_change_s_outward)), color = "navajowhite4") +
    geom_vline(aes(xintercept = mean(oney_change_ag)), color = "salmon4") + scale_y_continuous(limits = c(-0.2, 1))

jj <- ggplot(main_var_2020, aes(x = teny_change_ag, y = teny_change_s_outward)) + 
    geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "burlywood4", fill = "darkorange3") + geom_point(color = "chocolate2", alpha = .6) +
    labs(x = "Ten Year Change Agency", y = "Ten Year Change Outward Solidarity") + theme_minimal() + 
    geom_hline(aes(yintercept = mean(teny_change_s_outward)), color = "navajowhite4") +
    geom_vline(aes(xintercept = mean(teny_change_ag)), color = "burlywood") + scale_y_continuous(limits = c(-0.2, 1))
l <- grid.arrange(hh, ii, jj, nrow = 1, top = "Change of Agency and Outward Solidarity across time")

Looking at Agency and Material Gains

ggplot(main_var_2020, aes(x = agency_index, y = gdp_per_capita)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "bisque4", fill = "tan2") + geom_point(color = "sandybrown", alpha = .6) + 
  labs(title = "Relation between Agency and Material Gains") + theme(plot.title = element_text(lineheight = 0.5)) + 
  labs(x = "Agency Index", y = "GDP per Capita") + theme_minimal() + geom_hline(aes(yintercept = mean(gdp_per_capita)), color = "goldenrod2") + 
  geom_vline(aes(xintercept = mean(agency_index)), color = "wheat4")

Viewing correlation

cor_agmg <- cor.test(main_var_2020$agency_index, main_var_2020$gdp_per_capita, method = "pearson")

cor_agmg
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$agency_index and main_var_2020$gdp_per_capita
## t = 13.845, df = 86, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.7523078 0.8860901
## sample estimates:
##       cor 
## 0.8308389
test_agmg <- t.test(main_var_2020$agency_index, main_var_2020$gdp_per_capita)

test_agmg
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$agency_index and main_var_2020$gdp_per_capita
## t = -12.464, df = 87, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -29169.39 -21145.69
## sample estimates:
##    mean of x    mean of y 
## 6.658689e-01 2.515820e+04
ggplot(main_var_2020, aes(x = agency_index, y = gdp_per_capita)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "Agency Index", y = "GDP per Capita") + labs(title = "Correlation between Agency and Material Gains by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

ggplot(main_var_2020, aes(x = agency_index, y = gdp_per_capita)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_vline(aes(xintercept = mean(agency_index)), color = "wheat4") + theme_minimal() + labs(x = "Agency Index", y = "GDP per Capita") + labs(title = "Correlation between Agency and Material Gains by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Agency and Environment

ggplot(main_var_2020, aes(x = agency_index, y = CO2_per_capita)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "bisque4", fill = "darkslategrey") + geom_point(color = "cyan4", alpha = .6) + 
  labs(title = "Relation between Agency and Environment") + theme(plot.title = element_text(lineheight = 0.5)) + 
  labs(x = "Agency Index", y = "CO2 per capita") + theme_minimal() + geom_hline(aes(yintercept = mean(CO2_per_capita)), color = "palegreen4") + 
  geom_vline(aes(xintercept = mean(agency_index)), color = "wheat4")

Viewing correlation

cor_agenv <- cor.test(main_var_2020$agency_index, main_var_2020$CO2_per_capita, method = "pearson")

cor_agenv
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$agency_index and main_var_2020$CO2_per_capita
## t = 4.1214, df = 86, p-value = 8.641e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.2149630 0.5673084
## sample estimates:
##       cor 
## 0.4061208
test_agenv <- t.test(main_var_2020$agency_index, main_var_2020$CO2_per_capita)

test_agenv
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$agency_index and main_var_2020$CO2_per_capita
## t = -8.66, df = 87.134, p-value = 2.206e-13
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.431445 -3.403681
## sample estimates:
## mean of x mean of y 
## 0.6658689 5.0834318
ggplot(main_var_2020, aes(x = agency_index, y = CO2_per_capita)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "Agency Index", y = "CO2 per capita") + labs(title = "Correlation between Agency and Environment by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

ggplot(main_var_2020, aes(x = agency_index, y = CO2_per_capita)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_vline(aes(xintercept = mean(agency_index)), color = "wheat4") + theme_minimal() + labs(x = "Agency Index", y = "CO2 per Capita") + labs(title = "Correlation between Agency and Environment by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Material Gains and Solidarity

ggplot(main_var_2020, aes(x = gdp_per_capita, y = solidarity_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "brown", fill = "tan3") + geom_point(color = "firebrick", alpha = .6) + 
  labs(title = "Relation between Material Gains and Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
  labs(x = "GDP per capita", y = "Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(solidarity_index)), color = "sienna2") + 
  geom_vline(aes(xintercept = mean(gdp_per_capita)), color = "goldenrod2")

Viewing correlation

cor_matsol <- cor.test(main_var_2020$gdp_per_capita, main_var_2020$solidarity_index, method = "pearson")

cor_matsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$gdp_per_capita and main_var_2020$solidarity_index
## t = 9.4893, df = 86, p-value = 4.965e-15
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.594847 0.804172
## sample estimates:
##       cor 
## 0.7151869
test_matsol <- t.test(main_var_2020$gdp_per_capita, main_var_2020$solidarity_index)

test_matsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$gdp_per_capita and main_var_2020$solidarity_index
## t = 12.464, df = 87, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  21145.71 29169.40
## sample estimates:
##    mean of x    mean of y 
## 2.515820e+04 6.483791e-01
ggplot(main_var_2020, aes(x = gdp_per_capita, y = solidarity_index)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "GDP per capita", y = "Solidarity index") + labs(title = "Correlation between Material Gains and Solidarity by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

Here, we have outliers that heavily bends the mean line forward. In order to see it properly, I had to change the x and y axis

ggplot(main_var_2020, aes(x = solidarity_index, y = gdp_per_capita)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_vline(aes(xintercept = mean(solidarity_index)), color = "sienna2") + theme_minimal() + labs(x = "Solidarity Index", y = "GDP per capita") + labs(title = "Correlation between Material Gains and Solidarity by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Material Gains and Inward Solidarity

ggplot(main_var_2020, aes(x = gdp_per_capita, y = inward_sol_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "brown3", fill = "peachpuff") + geom_point(color = "navajowhite3", alpha = .6) + 
  labs(title = "Relation between Material Gains and Inward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
  labs(x = "GDP per capita", y = "Inward Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(inward_sol_index)), color = "red4") + 
  geom_vline(aes(xintercept = mean(gdp_per_capita)), color = "goldenrod2")

Viewing correlation

cor_matinsol <- cor.test(main_var_2020$gdp_per_capita, main_var_2020$inward_sol_index, method = "pearson")

cor_matinsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$gdp_per_capita and main_var_2020$inward_sol_index
## t = 9.7361, df = 86, p-value = 1.563e-15
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.6066567 0.8106047
## sample estimates:
##       cor 
## 0.7240957
test_matinsol <- t.test(main_var_2020$gdp_per_capita, main_var_2020$inward_sol_index)

test_matinsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$gdp_per_capita and main_var_2020$inward_sol_index
## t = 12.464, df = 87, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  21145.52 29169.22
## sample estimates:
##    mean of x    mean of y 
## 2.515820e+04 8.349043e-01
ggplot(main_var_2020, aes(x = gdp_per_capita, y = inward_sol_index)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "GDP per capita", y = "Inward Solidarity index") + labs(title = "Correlation between Material Gains and Inward Solidarity by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

ggplot(main_var_2020, aes(x = inward_sol_index, y = gdp_per_capita)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_vline(aes(xintercept = mean(inward_sol_index)), color = "red4") + theme_minimal() + labs(x = "Inward Solidarity Index", y = "GDP per capita") + labs(title = "Correlation between Material Gains and Inward Solidarity by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Material Gains and Outward Solidarity

ggplot(main_var_2020, aes(x = gdp_per_capita, y = outward_sol_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "saddlebrown", fill = "salmon2") + geom_point(color = "navajowhite3", alpha = .6) + 
  labs(title = "Relation between Material Gains and Outward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
  labs(x = "GDP per capita", y = "Outward Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(outward_sol_index)), color = "lightcoral") + 
  geom_vline(aes(xintercept = mean(gdp_per_capita)), color = "goldenrod2")

Viewing correlation

cor_matoutsol <- cor.test(main_var_2020$gdp_per_capita, main_var_2020$outward_sol_index, method = "pearson")

cor_matoutsol
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$gdp_per_capita and main_var_2020$outward_sol_index
## t = 3.4581, df = 86, p-value = 0.0008481
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1510075 0.5207346
## sample estimates:
##       cor 
## 0.3493992
test_matoutsol <- t.test(main_var_2020$gdp_per_capita, main_var_2020$outward_sol_index)

test_matoutsol
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$gdp_per_capita and main_var_2020$outward_sol_index
## t = 12.464, df = 87, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  21145.89 29169.59
## sample estimates:
##    mean of x    mean of y 
## 2.515820e+04 4.618539e-01
ggplot(main_var_2020, aes(x = gdp_per_capita, y = outward_sol_index)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "GDP per capita", y = "Outward Solidarity index") + labs(title = "Correlation between Material Gains and Outward Solidarity by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

ggplot(main_var_2020, aes(x = outward_sol_index, y = gdp_per_capita)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_vline(aes(xintercept = mean(outward_sol_index)), color = "lightcoral") + theme_minimal() + labs(x = "Outward Solidarity Index", y = "GDP per capita") + labs(title = "Correlation between Material Gains and Outward Solidarity by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Tying Solidarity and Material Gains using grid.Arrange

ab <- ggplot(main_var_2020, aes(x = gdp_per_capita, y = solidarity_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "brown", fill = "tan3") + geom_point(color = "firebrick", alpha = .6) +
  labs(x = "GDP per capita", y = "Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(solidarity_index)), color = "sienna2") + 
  geom_vline(aes(xintercept = mean(gdp_per_capita)), color = "goldenrod2") + scale_y_continuous(limits = c(0, 1)) 

bc <- ggplot(main_var_2020, aes(x = gdp_per_capita, y = inward_sol_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "brown3", fill = "peachpuff") + geom_point(color = "navajowhite3", alpha = .6) +
  labs(x = "GDP per capita", y = "Inward Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(inward_sol_index)), color = "red4") + 
  geom_vline(aes(xintercept = mean(gdp_per_capita)), color = "goldenrod2") + scale_y_continuous(limits = c(0, 1)) 

cd <- ggplot(main_var_2020, aes(x = gdp_per_capita, y = outward_sol_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "saddlebrown", fill = "salmon2") + geom_point(color = "navajowhite3", alpha = .6) +
  labs(x = "GDP per capita", y = "Outward Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(outward_sol_index)), color = "lightcoral") + 
  geom_vline(aes(xintercept = mean(gdp_per_capita)), color = "goldenrod2") + scale_y_continuous(limits = c(0, 1)) 
da <- grid.arrange(ab, bc, cd, nrow = 1, top = "Change of Material Gains and Solidarity")

Material Gains and Environment

ggplot(main_var_2020, aes(x = gdp_per_capita, y = CO2_per_capita)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "peru", fill = "seagreen") + geom_point(color = "chocolate2", alpha = .6) + 
  labs(title = "Relation between Material Gains and Environment") + theme(plot.title = element_text(lineheight = 0.5)) + 
  labs(x = "GDP per capita", y = "CO2 per capita") + theme_minimal() + geom_hline(aes(yintercept = mean(CO2_per_capita)), color = "palegreen4") + 
  geom_vline(aes(xintercept = mean(gdp_per_capita)), color = "goldenrod2")

cor_matenv <- cor.test(main_var_2020$gdp_per_capita, main_var_2020$CO2_per_capita, method = "pearson")

cor_matenv
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$gdp_per_capita and main_var_2020$CO2_per_capita
## t = 5.3164, df = 86, p-value = 8.243e-07
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.3213892 0.6401167
## sample estimates:
##       cor 
## 0.4973533
test_matenv <- t.test(main_var_2020$gdp_per_capita, main_var_2020$CO2_per_capita)

test_matenv
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$gdp_per_capita and main_var_2020$CO2_per_capita
## t = 12.462, df = 87, p-value < 2.2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  21141.27 29164.97
## sample estimates:
##    mean of x    mean of y 
## 25158.203352     5.083432
ggplot(main_var_2020, aes(x = gdp_per_capita, y = CO2_per_capita)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "GDP per capita", y = "CO2 per capita") + labs(title = "Correlation between Material Gains and Environment") + 
  theme(plot.title = element_text(lineheight = 0.5))

ggplot(main_var_2020, aes(x = CO2_per_capita, y = gdp_per_capita)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_vline(aes(xintercept = mean(CO2_per_capita)), color = "palegreen4") + theme_minimal() + labs(x = "CO2 per capita", y = "GDP per capita") + labs(title = "Correlation between Material Gains and Environment by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Environment and Solidarity

ggplot(main_var_2020, aes(x = CO2_per_capita, y = solidarity_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "indianred", fill = "seagreen") + geom_point(color = "firebrick", alpha = .6) + 
  labs(title = "Relation between Environment and Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
  labs(x = "CO2 per capita", y = "Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(solidarity_index)), color = "sienna3") + 
  geom_vline(aes(xintercept = mean(CO2_per_capita)), color = "palegreen4")

cor_solenv <- cor.test(main_var_2020$solidarity_index, main_var_2020$CO2_per_capita, method = "pearson")

cor_solenv
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$solidarity_index and main_var_2020$CO2_per_capita
## t = 4.1638, df = 86, p-value = 7.407e-05
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.2189444 0.5701351
## sample estimates:
##       cor 
## 0.4096038
test_solenv <- t.test(main_var_2020$solidarity_index, main_var_2020$CO2_per_capita)

test_solenv
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$solidarity_index and main_var_2020$CO2_per_capita
## t = -8.6965, df = 87.044, p-value = 1.871e-13
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.448688 -3.421418
## sample estimates:
## mean of x mean of y 
## 0.6483791 5.0834318
ggplot(main_var_2020, aes(x = CO2_per_capita, y = solidarity_index)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "CO2 per Capita", y = "Solidarity Index") + labs(title = "Correlation between Environment and Solidarity by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

ggplot(main_var_2020, aes(x = solidarity_index, y = CO2_per_capita)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_vline(aes(xintercept = mean(solidarity_index)), color = "sienna3") + theme_minimal() + labs(x = "Solidarity Index", y = "CO2 per Capita") + labs(title = "Correlation between Solidarity and Environment by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Environment and Inward Solidarity

ggplot(main_var_2020, aes(x = CO2_per_capita, y = inward_sol_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "lightsalmon2", fill = "seagreen") + geom_point(color = "navajowhite3", alpha = .6) + 
  labs(title = "Relation between Environment and Inward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
  labs(x = "CO2 per capita", y = "Inward Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(inward_sol_index)), color = "red4") + 
  geom_vline(aes(xintercept = mean(CO2_per_capita)), color = "palegreen4")

Viewing correlation

cor_insolenv <- cor.test(main_var_2020$inward_sol_index, main_var_2020$CO2_per_capita, method = "pearson")

cor_insolenv
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$inward_sol_index and main_var_2020$CO2_per_capita
## t = 5.1296, df = 86, p-value = 1.773e-06
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.3055635 0.6296406
## sample estimates:
##       cor 
## 0.4840289
test_insolenv <- t.test(main_var_2020$inward_sol_index, main_var_2020$CO2_per_capita)

test_insolenv
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$inward_sol_index and main_var_2020$CO2_per_capita
## t = -8.3297, df = 87.088, p-value = 1.048e-12
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.262284 -3.234771
## sample estimates:
## mean of x mean of y 
## 0.8349043 5.0834318
ggplot(main_var_2020, aes(x = CO2_per_capita, y = inward_sol_index)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "CO2 per Capita", y = "Inward Solidarity Index") + labs(title = "Correlation between Environment and Inward Solidarity by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

ggplot(main_var_2020, aes(x = inward_sol_index, y = CO2_per_capita)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_vline(aes(xintercept = mean(inward_sol_index)), color = "red4") + theme_minimal() + labs(x = "Inward Solidarity Index", y = "CO2 per Capita") + labs(title = "Correlation between Inward Solidarity and Environment by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Environment and Outward Solidarity

ggplot(main_var_2020, aes(x = CO2_per_capita, y = outward_sol_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "peachpuff3", fill = "seagreen") + geom_point(color = "bisque3", alpha = .6) + 
  labs(title = "Relation between Environment and Outward Solidarity") + theme(plot.title = element_text(lineheight = 0.5)) + 
  labs(x = "CO2 per capita", y = "Outward Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(outward_sol_index)), color = "navajowhite4") + 
  geom_vline(aes(xintercept = mean(CO2_per_capita)), color = "palegreen4")

Viewing correlation

cor_outenv <- cor.test(main_var_2020$outward_sol_index, main_var_2020$CO2_per_capita, method = "pearson")

cor_outenv
## 
##  Pearson's product-moment correlation
## 
## data:  main_var_2020$outward_sol_index and main_var_2020$CO2_per_capita
## t = 1.0766, df = 86, p-value = 0.2847
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.09645697  0.31709865
## sample estimates:
##       cor 
## 0.1153149
test_outenv <- t.test(main_var_2020$outward_sol_index, main_var_2020$CO2_per_capita)

test_outenv
## 
##  Welch Two Sample t-test
## 
## data:  main_var_2020$outward_sol_index and main_var_2020$CO2_per_capita
## t = -9.0619, df = 87.059, p-value = 3.337e-14
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.635254 -3.607902
## sample estimates:
## mean of x mean of y 
## 0.4618539 5.0834318
ggplot(main_var_2020, aes(x = CO2_per_capita, y = outward_sol_index)) + geom_point(aes(color = IncomeGroup)) + scale_color_locuszoom(name = "Income Group") + 
  theme_minimal() + labs(x = "CO2 per Capita", y = "Outward Solidarity Index") + labs(title = "Correlation between Environment and Outward Solidarity by Income Group") + 
  theme(plot.title = element_text(lineheight = 0.5))

ggplot(main_var_2020, aes(x = outward_sol_index, y = CO2_per_capita)) + geom_point(aes(color = IncomeGroup)) + geom_smooth(aes(color = IncomeGroup, fill = IncomeGroup), method = "lm", formula = y ~ x + I(x^2)) + scale_color_locuszoom(name = "Income Group") + scale_fill_locuszoom(name = element_blank(), labels = element_blank(), breaks = element_blank()) + geom_vline(aes(xintercept = mean(outward_sol_index)), color = "navajowhite4") + theme_minimal() + labs(x = "Outward Solidarity Index", y = "CO2 per Capita") + labs(title = "Correlation between Outward Solidarity and Environment by Individual Income Group") + theme(plot.title = element_text(lineheight = 0.5)) + facet_wrap(~ IncomeGroup) + stat_cor(aes(color = IncomeGroup))

Tying Environment and Solidarity using grid.Arrange

ca <- ggplot(main_var_2020, aes(x = CO2_per_capita, y = solidarity_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "indianred", fill = "seagreen") + geom_point(color = "firebrick", alpha = .6) +
  labs(x = "CO2 per capita", y = "Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(solidarity_index)), color = "sienna3") + 
  geom_vline(aes(xintercept = mean(CO2_per_capita)), color = "palegreen4") + scale_y_continuous(limits = c(0.2, 1)) 

db <- ggplot(main_var_2020, aes(x = CO2_per_capita, y = inward_sol_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "lightsalmon2", fill = "seagreen") + geom_point(color = "navajowhite3", alpha = .6) +
  labs(x = "CO2 per capita", y = "Inward Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(inward_sol_index)), color = "red4") + 
  geom_vline(aes(xintercept = mean(CO2_per_capita)), color = "palegreen4") + scale_y_continuous(limits = c(0.2, 1)) 

ec <- ggplot(main_var_2020, aes(x = CO2_per_capita, y = outward_sol_index)) + 
  geom_smooth(method = "lm", formula = y ~ x + I(x^2), color = "peachpuff3", fill = "seagreen") + geom_point(color = "bisque3", alpha = .6) +
  labs(x = "CO2 per capita", y = "Outward Solidarity index") + theme_minimal() + geom_hline(aes(yintercept = mean(outward_sol_index)), color = "navajowhite4") + 
  geom_vline(aes(xintercept = mean(CO2_per_capita)), color = "palegreen4") + scale_y_continuous(limits = c(0.2, 1)) 
da <- grid.arrange(ca, db, ec, nrow = 1, top = "Diversity of Environment and Solidarity")